Add MSP_SET_ADJUSTMENT_RANGE and MSP_ADJUSTMENT_RANGES commands.
[betaflight.git] / docs / Board - CMJCU.md
blob2083db82926d4c456eceb66990e99857367919d3
1 # Board - CMJCU
3 The CMJCU is a tiny (80mm) board running a STM32F103, which contains a 3-Axis Compass (HMC5883L) 
4 and an Accelerometer/Gyro (MPU6050).
6 This board does not have an onboard USB-Serial converter, so an external adapter is needed.
8 # Pins
10 RX Connections
12 | Pin Label | Description |
13 | --------- | ----------- |
14 | PA0       | Channel 1   |
15 | PA1       | Channel 2   |
16 | PA2       | Channel 3   |
17 | PA3       | Channel 4   |
18 | VCC       | Power +3.3v |
19 | GND       | Ground      |
21 Serial Connections
23 | Pin Label | Description     |
24 | --------- | --------------- |
25 | TX1       | Serial Transmit |
26 | RX1       | Serial Receive  |
27 | GND       | Ground          |
28 | 3V3       | Power +3.3v     |
29 | 5V        | Power +5v       |
31 Power Connections
33 | Pin Label | Description             |
34 | --------- | ----------------------- |
35 | Power +   | Power - 1 Cell 3.7v Max |
36 | Power -   | Ground                  |
38 Motor Connections
39 In standard QUADX configuration, the motors are mapped:
41 | Cleanflight | CMJCU  |
42 | ----------- | ------ |
43 | Motor 1     | Motor3 |
44 | Motor 2     | Motor2 |
45 | Motor 3     | Motor4 |
46 | Motor 4     | Motor1 |
48 It is therefore simplest to wire the motors:
49  * Motor 1 -> Clockwise
50  * Motor 2 -> Anti-Clockwise
51  * Motor 3 -> Clockwise
52  * Motor 4 -> Anti-Clockwise
54 If you are using the Hubsan x4/Ladybird motors, clockwise are Blue(GND)/Red(VCC) wires, anticlockwise
55 are Black(GND)/White(VCC)
57 If you have wired as above, Motor1/Motor2 on the board will be forward.
59 # Connecting a Serial-USB Adapter
61 You will need a USB -> Serial UART adapter. Connect:
63 | Adapter           | CMJCU                      |
64 | ----------------- | -------------------------- |
65 | Either 3.3v OR 5v | The correct 3.3v OR 5v pin |
66 | RX                | TX                         |
67 | TX                | RX                         |
69 When first connected this should power up the board, and will be in bootloader mode. If this does not happen, check 
70 the charge switch is set to POW.
71 After the flashing process has been completed, this will allow access via the cleanflight configurator to change 
72 settings or flash a new firmware.
74 WARNING: If the motors are connected and the board boots into the bootloader, they will start 
75 to spin after around 20 seconds, it is recommended not to connect the motors until the board
76 is flashed.
78 # Flashing
80 To flash the board:
81  * Open Cleanflight Configurator
82  * Download the CMJCU firmware binary (https://github.com/cleanflight/cleanflight/tree/master/obj/cleanflight_CJMCU.hex)
83  * Select "Load Firmware [Local]" and choose the CMJCU binary
84  * Tick "No Reboot Sequence" and "Full Chip Erase"
85  * Connect the USB->Serial adapter to the board
86  * Select the USB-UART adapter from the top left box
87  * Click "Flash Firmware"
88  * You should see "Programming: SUCCESSFUL" in the log box
89  * Click "Connect" -> This should open the "Initial Setup" tab and you should see sensor data from the quad shown
90  * Unplug the quad and solder across the 2 "BOOT0" pins - This prevents the board from going into bootloader mode on next
91    boot, if anything goes wrong, simply unsolder these pins and the bootloader will start, allowing you to reflash. You cannot
92    overwrite the bootloader.
94 # Helpful Hints
96  * If you are only using a 4 channel RX, in the auxiliary configuration tab, you can add a "Horizon" mode range around 1500 
97  for one of the the AUX channels which will result in it being always on
98  * Enabling the feature MOTOR_STOP helps with crashes so it doesn't try to keep spinning on its back
99  * When the power runs low, the quad will start jumping around a bit, if the flight behaviour seems strange, check your batteries charge